package ve.com.wayoyo.wuml_case;

import java.io.FileOutputStream;
import java.io.IOException;

import android.graphics.Bitmap;
import android.os.Environment;
import android.widget.Toast;

import ve.com.wayoyo.wuml_case.DibujoDiagramas.Diagrama;

public class Exporter {
	
	public void Guardar(String nombreArchivo,Diagrama diagrama ) throws IOException{
		FileOutputStream fos = null;
		try
		{
		    fos = new FileOutputStream(Environment.getExternalStorageDirectory()+"/WUML/"+nombreArchivo+".txt");
		    fos.write(diagrama.generarDOM().getBytes());
		    fos.flush();
		    fos.close();
		    fos = null;
		}
		catch (IOException e)
		{
		    throw e;
		}
		finally
		{
		    if (fos != null)
		    {
		        try
		        {
		            fos.close();
		            fos = null;
		        }
		        catch (IOException e)
		        {
		        	throw e;
		        }
		    }
		}
	}

}
